package dialogs;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.StyleRes;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.administrator.newxlmedical.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import custom.MyDialog;

/**
 * Created by Administrator on 2018/5/15.
 */

public class UserManageEditSucDialog extends MyDialog {
    private OnClickListener onClickListener;

    public UserManageEditSucDialog(Context context, @StyleRes int themeResId, OnClickListener onClickListener) {
        super(context, themeResId);
        this.onClickListener = onClickListener;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_user_manage_edit_succeed);
        ButterKnife.bind(this);
        //设置不可取消，点击其他区域不能取消
        setCancelable(false);
        setCanceledOnTouchOutside(false);
    }

    @OnClick({R.id.tv_user_manage_edit_suc_sure, R.id.tv_user_manage_edit_suc_close})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_user_manage_edit_suc_sure:
                onClickListener.onSure(this);
                break;
            case R.id.tv_user_manage_edit_suc_close:
                onClickListener.onSure(this);
                break;
        }
    }

    public interface OnClickListener {
        void onSure(UserManageEditSucDialog dialog);
    }
}
